{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}C:\research\works\주제40_집_이민자_외국인지원\data\code_robustness_Hausman.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res} 3 May 2025, 22:05:49

{com}. tsset id year
{res}{txt}{col 8}panel variable:  {res}id (unbalanced)
{txt}{col 9}time variable:  {res}{col 25}year, 2005 to 2022, but with gaps
{txt}{col 17}delta:  {res}1 unit

{com}. xtreg foreigner_right i.immigration##i.homeownership ln_income education sex age marriage capital religion ideology, fe
{p 0 6 2}{txt}note: 1.immigration omitted because of collinearity{p_end}
{p 0 6 2}note: sex omitted because of collinearity{p_end}
{res}
{txt}Fixed-effects (within) regression{col 49}Number of obs{col 67}={col 69}{res}     4,446
{txt}Group variable: {res}id{txt}{col 49}Number of groups{col 67}={col 69}{res}     3,048

{txt}R-sq:{col 49}Obs per group:
     within  = {res}0.0155{col 63}{txt}min{col 67}={col 69}{res}         1
{txt}     between = {res}0.0003{col 63}{txt}avg{col 67}={col 69}{res}       1.5
{txt}     overall = {res}0.0002{col 63}{txt}max{col 67}={col 69}{res}         2

{txt}{col 49}F({res}9{txt},{res}1389{txt}){col 67}={col 70}{res}     2.43
{txt}corr(u_i, Xb){col 16}= {res}-0.4361{txt}{col 49}Prob > F{col 67}={col 73}{res}0.0096

{txt}{hline 26}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}          foreigner_right{col 27}{c |}      Coef.{col 39}   Std. Err.{col 51}      t{col 59}   P>|t|{col 67}     [95% Con{col 80}f. Interval]
{hline 26}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 12}1.immigration {c |}{col 27}{res}{space 2}        0{col 39}{txt}  (omitted)
{space 10}1.homeownership {c |}{col 27}{res}{space 2}-.0168285{col 39}{space 2}  .079692{col 50}{space 1}   -0.21{col 59}{space 3}0.833{col 67}{space 4}-.1731581{col 80}{space 3} .1395012
{txt}{space 25} {c |}
immigration#homeownership {c |}
{space 21}1 1  {c |}{col 27}{res}{space 2}-2.983293{col 39}{space 2} 1.035876{col 50}{space 1}   -2.88{col 59}{space 3}0.004{col 67}{space 4}-5.015343{col 80}{space 3}-.9512418
{txt}{space 25} {c |}
{space 16}ln_income {c |}{col 27}{res}{space 2}-.1228584{col 39}{space 2} .0584687{col 50}{space 1}   -2.10{col 59}{space 3}0.036{col 67}{space 4}-.2375549{col 80}{space 3}-.0081619
{txt}{space 16}education {c |}{col 27}{res}{space 2}-.2121764{col 39}{space 2}  .221215{col 50}{space 1}   -0.96{col 59}{space 3}0.338{col 67}{space 4}-.6461279{col 80}{space 3} .2217751
{txt}{space 22}sex {c |}{col 27}{res}{space 2}        0{col 39}{txt}  (omitted)
{space 22}age {c |}{col 27}{res}{space 2} -.106714{col 39}{space 2} .0496574{col 50}{space 1}   -2.15{col 59}{space 3}0.032{col 67}{space 4}-.2041256{col 80}{space 3}-.0093025
{txt}{space 17}marriage {c |}{col 27}{res}{space 2}-.0006414{col 39}{space 2} .1581442{col 50}{space 1}   -0.00{col 59}{space 3}0.997{col 67}{space 4}-.3108688{col 80}{space 3} .3095859
{txt}{space 18}capital {c |}{col 27}{res}{space 2} .0248058{col 39}{space 2} .2157172{col 50}{space 1}    0.11{col 59}{space 3}0.908{col 67}{space 4} -.398361{col 80}{space 3} .4479725
{txt}{space 17}religion {c |}{col 27}{res}{space 2} .0670575{col 39}{space 2} .0655575{col 50}{space 1}    1.02{col 59}{space 3}0.307{col 67}{space 4}-.0615449{col 80}{space 3} .1956598
{txt}{space 17}ideology {c |}{col 27}{res}{space 2} .0268257{col 39}{space 2} .0271169{col 50}{space 1}    0.99{col 59}{space 3}0.323{col 67}{space 4}-.0263689{col 80}{space 3} .0800203
{txt}{space 20}_cons {c |}{col 27}{res}{space 2} 4.868098{col 39}{space 2} .8060381{col 50}{space 1}    6.04{col 59}{space 3}0.000{col 67}{space 4} 3.286915{col 80}{space 3} 6.449282
{txt}{hline 26}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
                  sigma_u {c |} {res} .78942723
                  {txt}sigma_e {c |} {res} .73030412
                      {txt}rho {c |} {res} .53884486{txt}   (fraction of variance due to u_i)
{hline 26}{c BT}{hline 64}
F test that all u_i=0: F({res}3047{txt}, {res}1389{txt}) = {res}1.23{col 62}{txt}Prob > F = {res}0.0000

{com}. 
. estimates store fe_model

. 
. 
. 
. xtreg foreigner_right i.immigration##i.homeownership ln_income education sex age marriage capital religion ideology, re
{res}
{txt}Random-effects GLS regression                   Number of obs     = {res}     4,446
{txt}Group variable: {res}id                              {txt}Number of groups  = {res}     3,048

{txt}R-sq:                                           Obs per group:
     within  = {res}0.0075                                         {txt}min = {res}         1
{txt}     between = {res}0.0608                                         {txt}avg = {res}       1.5
{txt}     overall = {res}0.0501                                         {txt}max = {res}         2

                                                {txt}Wald chi2({res}11{txt})     =  {res}   221.08
{txt}corr(u_i, X)   = {res}0{txt} (assumed)                    Prob > chi2       =     {res}0.0000

{txt}{hline 26}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}          foreigner_right{col 27}{c |}      Coef.{col 39}   Std. Err.{col 51}      z{col 59}   P>|z|{col 67}     [95% Con{col 80}f. Interval]
{hline 26}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 12}1.immigration {c |}{col 27}{res}{space 2} 1.831078{col 39}{space 2} .1915528{col 50}{space 1}    9.56{col 59}{space 3}0.000{col 67}{space 4} 1.455642{col 80}{space 3} 2.206515
{txt}{space 10}1.homeownership {c |}{col 27}{res}{space 2}-.0951903{col 39}{space 2} .0268592{col 50}{space 1}   -3.54{col 59}{space 3}0.000{col 67}{space 4}-.1478333{col 80}{space 3}-.0425473
{txt}{space 25} {c |}
immigration#homeownership {c |}
{space 21}1 1  {c |}{col 27}{res}{space 2}-2.335977{col 39}{space 2} .2518525{col 50}{space 1}   -9.28{col 59}{space 3}0.000{col 67}{space 4}-2.829599{col 80}{space 3}-1.842355
{txt}{space 25} {c |}
{space 16}ln_income {c |}{col 27}{res}{space 2}  -.05613{col 39}{space 2} .0219937{col 50}{space 1}   -2.55{col 59}{space 3}0.011{col 67}{space 4}-.0992367{col 80}{space 3}-.0130232
{txt}{space 16}education {c |}{col 27}{res}{space 2} .0512666{col 39}{space 2} .0149779{col 50}{space 1}    3.42{col 59}{space 3}0.001{col 67}{space 4} .0219105{col 80}{space 3} .0806228
{txt}{space 22}sex {c |}{col 27}{res}{space 2}-.0473669{col 39}{space 2} .0254708{col 50}{space 1}   -1.86{col 59}{space 3}0.063{col 67}{space 4}-.0972888{col 80}{space 3}  .002555
{txt}{space 22}age {c |}{col 27}{res}{space 2}-.0363309{col 39}{space 2} .0117392{col 50}{space 1}   -3.09{col 59}{space 3}0.002{col 67}{space 4}-.0593394{col 80}{space 3}-.0133224
{txt}{space 17}marriage {c |}{col 27}{res}{space 2} .0752064{col 39}{space 2} .0300383{col 50}{space 1}    2.50{col 59}{space 3}0.012{col 67}{space 4} .0163324{col 80}{space 3} .1340804
{txt}{space 18}capital {c |}{col 27}{res}{space 2} .1066784{col 39}{space 2} .0250774{col 50}{space 1}    4.25{col 59}{space 3}0.000{col 67}{space 4} .0575276{col 80}{space 3} .1558292
{txt}{space 17}religion {c |}{col 27}{res}{space 2}-.0227819{col 39}{space 2} .0244917{col 50}{space 1}   -0.93{col 59}{space 3}0.352{col 67}{space 4}-.0707849{col 80}{space 3}  .025221
{txt}{space 17}ideology {c |}{col 27}{res}{space 2}    -.016{col 39}{space 2} .0131443{col 50}{space 1}   -1.22{col 59}{space 3}0.224{col 67}{space 4}-.0417624{col 80}{space 3} .0097624
{txt}{space 20}_cons {c |}{col 27}{res}{space 2} 3.408917{col 39}{space 2} .1997747{col 50}{space 1}   17.06{col 59}{space 3}0.000{col 67}{space 4} 3.017365{col 80}{space 3} 3.800468
{txt}{hline 26}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
                  sigma_u {c |} {res} .26569543
                  {txt}sigma_e {c |} {res} .73030412
                      {txt}rho {c |} {res} .11688955{txt}   (fraction of variance due to u_i)
{hline 26}{c BT}{hline 64}

{com}. 
. estimates store re_model

. 
. 
. 
. hausman fe_model re_model

{txt}{col 18}{hline 4} Coefficients {hline 4}
{col 14}{c |}{col 21}(b){col 34}(B){col 49}(b-B){col 59}sqrt(diag(V_b-V_B))
{col 14}{c |}{col 17}  fe_model  {col 30}  re_model  {col 46}Difference{col 66}S.E.
{hline 13}{c +}{hline 64}
1.homeowne~p {c |}{res}{col 18}-.0168285{col 31}-.0951903{col 47} .0783618{col 63} .0750293
{txt}{space 1}immigration#{c |}
homeowners~p {c |}
{space 8}1 1  {c |}{res}{col 18}-2.983293{col 31}-2.335977{col 47}-.6473157{col 63} 1.004793
{txt}{space 3}ln_income {c |}{res}{col 18}-.1228584{col 31}  -.05613{col 47}-.0667284{col 63} .0541744
{txt}{space 3}education {c |}{res}{col 18}-.2121764{col 31} .0512666{col 47} -.263443{col 63} .2207073
{txt}{space 9}age {c |}{res}{col 18} -.106714{col 31}-.0363309{col 47}-.0703831{col 63} .0482498
{txt}{space 4}marriage {c |}{res}{col 18}-.0006414{col 31} .0752064{col 47}-.0758478{col 63} .1552653
{txt}{space 5}capital {c |}{res}{col 18} .0248058{col 31} .1066784{col 47}-.0818727{col 63} .2142546
{txt}{space 4}religion {c |}{res}{col 18} .0670575{col 31}-.0227819{col 47} .0898394{col 63} .0608107
{txt}{space 4}ideology {c |}{res}{col 18} .0268257{col 31}    -.016{col 47} .0428257{col 63} .0237183
{txt}{hline 13}{c BT}{hline 64}
{ralign 78:b = consistent under Ho and Ha; obtained from xtreg}
{ralign 78:B = inconsistent under Ha, efficient under Ho; obtained from xtreg}

    Test:  Ho:  difference in coefficients not systematic

{ralign 25:chi2({res:9})} = (b-B)'[(V_b-V_B)^(-1)](b-B)
{col 27}=  {res}     13.46
{txt}{col 17}Prob>chi2 =  {res}    0.1428

{com}. 
. 
. 
. 
. 
. xtreg foreigner_support i.immigration##i.homeownership ln_income education sex age marriage capital religion ideology, fe
{p 0 6 2}{txt}note: 1.immigration omitted because of collinearity{p_end}
{p 0 6 2}note: sex omitted because of collinearity{p_end}
{res}
{txt}Fixed-effects (within) regression{col 49}Number of obs{col 67}={col 69}{res}     4,404
{txt}Group variable: {res}id{txt}{col 49}Number of groups{col 67}={col 69}{res}     3,033

{txt}R-sq:{col 49}Obs per group:
     within  = {res}0.0140{col 63}{txt}min{col 67}={col 69}{res}         1
{txt}     between = {res}0.0000{col 63}{txt}avg{col 67}={col 69}{res}       1.5
{txt}     overall = {res}0.0006{col 63}{txt}max{col 67}={col 69}{res}         2

{txt}{col 49}F({res}9{txt},{res}1362{txt}){col 67}={col 70}{res}     2.15
{txt}corr(u_i, Xb){col 16}= {res}-0.4729{txt}{col 49}Prob > F{col 67}={col 73}{res}0.0232

{txt}{hline 26}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}        foreigner_support{col 27}{c |}      Coef.{col 39}   Std. Err.{col 51}      t{col 59}   P>|t|{col 67}     [95% Con{col 80}f. Interval]
{hline 26}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 12}1.immigration {c |}{col 27}{res}{space 2}        0{col 39}{txt}  (omitted)
{space 10}1.homeownership {c |}{col 27}{res}{space 2}-.1552237{col 39}{space 2} .0875388{col 50}{space 1}   -1.77{col 59}{space 3}0.076{col 67}{space 4}-.3269492{col 80}{space 3} .0165018
{txt}{space 25} {c |}
immigration#homeownership {c |}
{space 21}1 1  {c |}{col 27}{res}{space 2}-2.844791{col 39}{space 2}  1.12479{col 50}{space 1}   -2.53{col 59}{space 3}0.012{col 67}{space 4}  -5.0513{col 80}{space 3}-.6382818
{txt}{space 25} {c |}
{space 16}ln_income {c |}{col 27}{res}{space 2}-.0146699{col 39}{space 2} .0645972{col 50}{space 1}   -0.23{col 59}{space 3}0.820{col 67}{space 4}-.1413907{col 80}{space 3} .1120509
{txt}{space 16}education {c |}{col 27}{res}{space 2}-.2145409{col 39}{space 2} .2402151{col 50}{space 1}   -0.89{col 59}{space 3}0.372{col 67}{space 4}-.6857725{col 80}{space 3} .2566908
{txt}{space 22}sex {c |}{col 27}{res}{space 2}        0{col 39}{txt}  (omitted)
{space 22}age {c |}{col 27}{res}{space 2}-.0041296{col 39}{space 2} .0543425{col 50}{space 1}   -0.08{col 59}{space 3}0.939{col 67}{space 4}-.1107337{col 80}{space 3} .1024744
{txt}{space 17}marriage {c |}{col 27}{res}{space 2}-.1083434{col 39}{space 2} .1697254{col 50}{space 1}   -0.64{col 59}{space 3}0.523{col 67}{space 4} -.441295{col 80}{space 3} .2246082
{txt}{space 18}capital {c |}{col 27}{res}{space 2} .4995705{col 39}{space 2} .2342276{col 50}{space 1}    2.13{col 59}{space 3}0.033{col 67}{space 4} .0400844{col 80}{space 3} .9590565
{txt}{space 17}religion {c |}{col 27}{res}{space 2}-.0426541{col 39}{space 2} .0714693{col 50}{space 1}   -0.60{col 59}{space 3}0.551{col 67}{space 4}-.1828559{col 80}{space 3} .0975476
{txt}{space 17}ideology {c |}{col 27}{res}{space 2}-.0398897{col 39}{space 2} .0298935{col 50}{space 1}   -1.33{col 59}{space 3}0.182{col 67}{space 4}-.0985321{col 80}{space 3} .0187527
{txt}{space 20}_cons {c |}{col 27}{res}{space 2}  3.56575{col 39}{space 2} .8803572{col 50}{space 1}    4.05{col 59}{space 3}0.000{col 67}{space 4} 1.838747{col 80}{space 3} 5.292753
{txt}{hline 26}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
                  sigma_u {c |} {res} .87062915
                  {txt}sigma_e {c |} {res} .79293418
                      {txt}rho {c |} {res} .54660229{txt}   (fraction of variance due to u_i)
{hline 26}{c BT}{hline 64}
F test that all u_i=0: F({res}3032{txt}, {res}1362{txt}) = {res}1.23{col 62}{txt}Prob > F = {res}0.0000

{com}. 
. estimates store fe_model

. 
. 
. 
. xtreg foreigner_support i.immigration##i.homeownership ln_income education sex age marriage capital religion ideology, re
{res}
{txt}Random-effects GLS regression                   Number of obs     = {res}     4,404
{txt}Group variable: {res}id                              {txt}Number of groups  = {res}     3,033

{txt}R-sq:                                           Obs per group:
     within  = {res}0.0066                                         {txt}min = {res}         1
{txt}     between = {res}0.0288                                         {txt}avg = {res}       1.5
{txt}     overall = {res}0.0280                                         {txt}max = {res}         2

                                                {txt}Wald chi2({res}11{txt})     =  {res}   117.83
{txt}corr(u_i, X)   = {res}0{txt} (assumed)                    Prob > chi2       =     {res}0.0000

{txt}{hline 26}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}        foreigner_support{col 27}{c |}      Coef.{col 39}   Std. Err.{col 51}      z{col 59}   P>|z|{col 67}     [95% Con{col 80}f. Interval]
{hline 26}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 12}1.immigration {c |}{col 27}{res}{space 2} 1.471831{col 39}{space 2} .2087088{col 50}{space 1}    7.05{col 59}{space 3}0.000{col 67}{space 4}  1.06277{col 80}{space 3} 1.880893
{txt}{space 10}1.homeownership {c |}{col 27}{res}{space 2}-.1869739{col 39}{space 2} .0294077{col 50}{space 1}   -6.36{col 59}{space 3}0.000{col 67}{space 4} -.244612{col 80}{space 3}-.1293358
{txt}{space 25} {c |}
immigration#homeownership {c |}
{space 21}1 1  {c |}{col 27}{res}{space 2}-1.252247{col 39}{space 2} .2744055{col 50}{space 1}   -4.56{col 59}{space 3}0.000{col 67}{space 4}-1.790072{col 80}{space 3}-.7144219
{txt}{space 25} {c |}
{space 16}ln_income {c |}{col 27}{res}{space 2} .0360813{col 39}{space 2} .0240809{col 50}{space 1}    1.50{col 59}{space 3}0.134{col 67}{space 4}-.0111165{col 80}{space 3}  .083279
{txt}{space 16}education {c |}{col 27}{res}{space 2} .0127033{col 39}{space 2} .0163838{col 50}{space 1}    0.78{col 59}{space 3}0.438{col 67}{space 4}-.0194083{col 80}{space 3} .0448149
{txt}{space 22}sex {c |}{col 27}{res}{space 2}-.0476667{col 39}{space 2} .0278646{col 50}{space 1}   -1.71{col 59}{space 3}0.087{col 67}{space 4}-.1022804{col 80}{space 3} .0069469
{txt}{space 22}age {c |}{col 27}{res}{space 2} .0403754{col 39}{space 2} .0128647{col 50}{space 1}    3.14{col 59}{space 3}0.002{col 67}{space 4}  .015161{col 80}{space 3} .0655897
{txt}{space 17}marriage {c |}{col 27}{res}{space 2}-.0436893{col 39}{space 2} .0328974{col 50}{space 1}   -1.33{col 59}{space 3}0.184{col 67}{space 4} -.108167{col 80}{space 3} .0207884
{txt}{space 18}capital {c |}{col 27}{res}{space 2}-.0121752{col 39}{space 2} .0274555{col 50}{space 1}   -0.44{col 59}{space 3}0.657{col 67}{space 4}-.0659869{col 80}{space 3} .0416365
{txt}{space 17}religion {c |}{col 27}{res}{space 2}  .018506{col 39}{space 2} .0267869{col 50}{space 1}    0.69{col 59}{space 3}0.490{col 67}{space 4}-.0339953{col 80}{space 3} .0710074
{txt}{space 17}ideology {c |}{col 27}{res}{space 2}-.0489288{col 39}{space 2} .0144333{col 50}{space 1}   -3.39{col 59}{space 3}0.001{col 67}{space 4}-.0772177{col 80}{space 3}  -.02064
{txt}{space 20}_cons {c |}{col 27}{res}{space 2} 2.497821{col 39}{space 2} .2188449{col 50}{space 1}   11.41{col 59}{space 3}0.000{col 67}{space 4} 2.068892{col 80}{space 3} 2.926749
{txt}{hline 26}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
                  sigma_u {c |} {res} .28909499
                  {txt}sigma_e {c |} {res} .79293418
                      {txt}rho {c |} {res} .11732908{txt}   (fraction of variance due to u_i)
{hline 26}{c BT}{hline 64}

{com}. 
. estimates store re_model

. 
. 
. 
. hausman fe_model re_model

{txt}{col 18}{hline 4} Coefficients {hline 4}
{col 14}{c |}{col 21}(b){col 34}(B){col 49}(b-B){col 59}sqrt(diag(V_b-V_B))
{col 14}{c |}{col 17}  fe_model  {col 30}  re_model  {col 46}Difference{col 66}S.E.
{hline 13}{c +}{hline 64}
1.homeowne~p {c |}{res}{col 18}-.1552237{col 31}-.1869739{col 47} .0317502{col 63} .0824514
{txt}{space 1}immigration#{c |}
homeowners~p {c |}
{space 8}1 1  {c |}{res}{col 18}-2.844791{col 31}-1.252247{col 47}-1.592544{col 63} 1.090805
{txt}{space 3}ln_income {c |}{res}{col 18}-.0146699{col 31} .0360813{col 47}-.0507512{col 63} .0599409
{txt}{space 3}education {c |}{res}{col 18}-.2145409{col 31} .0127033{col 47}-.2272442{col 63} .2396557
{txt}{space 9}age {c |}{res}{col 18}-.0041296{col 31} .0403754{col 47} -.044505{col 63} .0527978
{txt}{space 4}marriage {c |}{res}{col 18}-.1083434{col 31}-.0436893{col 47}-.0646541{col 63} .1665067
{txt}{space 5}capital {c |}{res}{col 18} .4995705{col 31}-.0121752{col 47} .5117456{col 63}  .232613
{txt}{space 4}religion {c |}{res}{col 18}-.0426541{col 31}  .018506{col 47}-.0611601{col 63} .0662595
{txt}{space 4}ideology {c |}{res}{col 18}-.0398897{col 31}-.0489288{col 47} .0090391{col 63} .0261783
{txt}{hline 13}{c BT}{hline 64}
{ralign 78:b = consistent under Ho and Ha; obtained from xtreg}
{ralign 78:B = inconsistent under Ha, efficient under Ho; obtained from xtreg}

    Test:  Ho:  difference in coefficients not systematic

{ralign 25:chi2({res:9})} = (b-B)'[(V_b-V_B)^(-1)](b-B)
{col 27}=  {res}     10.75
{txt}{col 17}Prob>chi2 =  {res}    0.2935

{com}. log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}C:\research\works\주제40_집_이민자_외국인지원\data\code_robustness_Hausman.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res} 3 May 2025, 22:06:18
{txt}{.-}
{smcl}
{txt}{sf}{ul off}